package com.woniuxy.carrental.service.impl;

import com.woniuxy.carrental.entity.Supplier;
import com.woniuxy.carrental.mapper.SupplierMapper;
import com.woniuxy.carrental.service.SupplierService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xilei
 * @create 2021-09-29 下午 2:25
 */
@Service
public class SupplierServiceImpl implements SupplierService {
    @Resource
    SupplierMapper supplierMapper;

    @Override
    public List<Supplier> findSupplier() {
        List<Supplier> supplierlist = supplierMapper.findSupplier();
        return supplierlist;
    }

    @Override
    public List<Supplier> findSupplierByPage(int pageIndex, int pageSize) {
        List<Supplier> supplierList = supplierMapper.findSupplierByPage(pageIndex, pageSize);
        return supplierList;
    }

    @Override
    public void updateSupplier(String supplier_name, String supplier_address, String supplier_telephone, String supplier_contant, Integer supplier_id) {
        supplierMapper.updateSupplier(supplier_name,supplier_address,supplier_telephone,supplier_contant,supplier_id);
    }

    @Override
    public void insertSupplier(Supplier supplier) {
        supplierMapper.insertSupplier(supplier);
    }

    @Override
    public List<Supplier> findSupplierByPageByParam(String supplier_name, String supplier_address, String supplier_telephone, String supplier_contant, int pageIndex, int pageSize) {
        List<Supplier> list = supplierMapper.findSupplierByPageByParam(supplier_name, supplier_address, supplier_telephone, supplier_contant, pageIndex, pageSize);
        return list;
    }

    @Override
    public void deleteSupplier(Integer supplier_id) {
        supplierMapper.deleteSupplier(supplier_id);
    }
}
